$(window).on('scroll', function () {
    var oSt = $(document).scrollTop();
	
	var oW = $(document).width();
	if(oW <= 480){
		$('.fixedbtn').fadeOut('100');
		return false;
	}

    if (oSt > 600) {
        $('.fixedbtn').fadeIn('100');
    } else {
        $('.fixedbtn').fadeOut('100');
    }
});

window.onresize = window.onscroll = function () {

    var oBackTop = document.getElementById('backTop'),
            ofixedBtn = document.getElementById('fixedBtn'),
            oScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
            oBackTimer = null;

    if (!oBackTop) {
        return false;
    }
    oBackTop.style.top = oScrollTop + (document.documentElement.clientHeight - oBackTop.offsetHeight) / 2 + 'px';

    oBackTop.onclick = FnBack;
    function FnBack() {
        oBackTimer = setInterval(FnBackSpeed, 20);
        if (!oBackTimer) {
            oBackTimer = setInterval(FnBackSpeed, 20);
        }
    }
    ;

    function FnBackSpeed() {
        var oScrollTop = document.documentElement.scrollTop || document.body.scrollTop, oSpeed = oScrollTop / 10;

        if (oSpeed < 20) {
            oSpeed = 20;
        }

        if (document.body.scrollTop) {
            document.body.scrollTop -= oSpeed;
        } else {
            document.documentElement.scrollTop -= oSpeed;
        }
        oScrollTop = document.documentElement.scrollTop || document.body.scrollTop;

        if (oScrollTop == 0) {
            clearInterval(oBackTimer);
            oBackTimer = null;
        }
        ;
    }
    ;
};


